package com.qf.controller;

import com.qf.pojo.resVo.BaseResult;
import com.qf.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/course")
@RestController
public class CourseController {

    @Autowired
    CourseService courseService;

    @RequestMapping("/findCourseByClassify/{id}/{page}/{size}")
    public BaseResult findCourseByClassify(@PathVariable("id")Integer id,
                                           @PathVariable("page")Integer page,
                                           @PathVariable("size")Integer size){
        return courseService.findCourseByClassify(id,page,size);
    }
    /**
     * 通过课程id查询课程的详细信息
     */
    @RequestMapping("/findCourseDetailById/{id}")
    public BaseResult findCourseDetailById(@PathVariable("id")Integer id){
        return courseService.findCourseDetailById(id);
    }


}
